<#include "../../ajaxPage.ftl" />
<#include "../../display.ftl" />
<table class="table table-datatable table-gray">
    <input type="hidden" id="selectVipId" name="vipId"/>
    <input type="hidden" id="selectProductName" name="productName"/>
    <thead>
    <tr>
        <th>产品名称</th>
        <th>周期</th>
        <th>上门次数</th>
        <th>价格</th>
        <th>会员类型</th>
    </tr>
    </thead>
    <tbody>
    <#if cardTypesTable.rows??>
        <#list cardTypesTable.rows as cardType>
        <tr>

            <td style='display:none;'>${cardType.id!''}</td>
            <td>${cardType.productName!''}</td>
            <td>${cardType.cycle!''}</td>
            <td>${cardType.doorNum!''}</td>
            <td>${cardType.price!''}</td>

            <td>
                <@display list=vipTypeList value="${cardType.vipType!''}"/>
            </td>
        </tr>
        </#list>
    </#if>
    </tbody>
</table>
<#if cardTypesTable??>
    <@page table=cardTypesTable formId="search_cardtype_select" contentId="selectContent"/>
</#if>
<script>
    $(function () {
        $("table tbody tr").click(function () {
            $("table tbody tr").removeClass("active");
            $(this).addClass("active");
            var vipId = $(this).children("td:eq(0)").text();
            var productName = $(this).children("td:eq(1)").text();
            if (vipId != "" && productName != "") {
                $("#selectVipId").val(vipId);
                $("#selectProductName").val(productName);
            }
        });
    });
</script>